﻿using System.ComponentModel.DataAnnotations;
using PortalWeb.CMS.Core.Entity;
using PortalWeb.I18N;

namespace PortalWeb.Models.Cms
{
    public class ArticleViewModel : CommonModelViewModel
    {
        public ArticleViewModel() { }

        public ArticleViewModel(Article article)
        {
            this.Id = article.Id;
            this.Intro = article.Intro;
            this.Source = article.Source;
            this.Content = article.Content;
            this.Status = article.CommonModel.Status;
            this.Title = article.CommonModel.Title;
            this.ReleaseDate = article.CommonModel.ReleaseDate;
            this.Inputer = article.CommonModel.Inputer;
            this.DefaultPicUrl = article.CommonModel.DefaultPicUrl;
        }

        [Required]
        [Display(ResourceType = typeof (Resources), Name = "Content")]
        public string Content { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Intro")]
        public string Intro { get; set; }

    }
}